#循环while
'''
i = 1
while i<= 10:   #条件恒成立，无限循环
    print("I love you!")
'''
"""
i = 1
while i<=5:
    print("I love you!")
    i += 1
"""

#计算1-100的累计和
i = 1
sum1 = 0
while i<=100:
    sum1 = sum1 + i
    i += 1
print(f'1-100的累计和是;{sum1}')

#计算1-100偶数累计和
i = 1
sum1 = 0
while i<=100:
    if i % 2 == 0: #判断为偶数
        sum1 = sum1 + i
    i += 1
print(f'1-100间的偶数累计和是;{sum1}')
